package com.dkm.dkmproject.service.impl;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.dkm.dkmproject.dao.RecordTbMapper;
import com.dkm.dkmproject.domain.RecordTb;
import com.dkm.dkmproject.service.IRecordTbService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 提现记录表 服务实现类
 * </p>
 *
 * @author 周佳佳
 * @since 2020-04-26
 */
@Service
public class RecordTbServiceImpl extends ServiceImpl<RecordTbMapper, RecordTb> implements IRecordTbService {
    @Autowired
    RecordTbMapper recordTbMapper;
    @Override
    public List<RecordTb> findByUserId(Integer userId) {
        EntityWrapper<RecordTb> entityWrapper=new EntityWrapper<>();
        entityWrapper.eq("user_id",userId);
        return recordTbMapper.selectList(entityWrapper);
    }

    @Override
    public List<RecordTb> selectAllTwo(Integer pageNum, Integer pageSize,String userName) {
        PageHelper.startPage(pageNum,pageSize);
        return recordTbMapper.selectAllTwo(userName);
    }

    @Override
    public int selectCountOne(String userName) {
        return recordTbMapper.selectCountOne(userName);
    }
}
